/*
 * timer.c
 *
 *  Created on: Mar 13, 2013
 *      Author: abrahamsantini
 */
#include <sys/time.h>
#include <stdio.h>
#include <pthread.h>
#include <errno.h>
#include "timer.h"
#include "cpu.h"

void* start(void* cpu) {
	while(1) {
		usleep(500);
		doClockInterrupt((CPU*)cpu);
	}
	return NULL;
}

int timer_init(CPU* cpu) {

	  pthread_t timer_thread;

    pthread_create(&timer_thread,NULL,start, cpu);
	return 0;
}
